import { INCREMENT, DECREMENT } from "../constants/countConstants"
import store from "../store"
//累加的action
export function incrementCount(data) {
    return {
        type: INCREMENT,
        data
    }
}
//累减的action
export function decrementCount(data) {
    return {
        type: DECREMENT,
        data
    }
}
//异步的action
export function waitDecrementCount(data) {
    return () => {
        setTimeout(() => {
            store.dispatch({
                type: INCREMENT,
                data
            })
        }, 2000);
    }
}
